package com.clouds.wms.service;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.clouds.wms.bean.Purmb;
import com.clouds.wms.bean.Purmd;
import com.clouds.wms.dao.PurmcDao;
import com.clouds.wms.dao.PurmdDao;
import com.clouds.wms.exception.SysException;
import com.clouds.wms.util.PagesBean;

@Service("purmdService")
public class PurmdServiceImpl implements PurmdService {
	@Resource(name="purmcDao")
	private PurmcDao purmcDao;
	@Resource(name="purmdDao")
	private PurmdDao purmdDao;

	@Override
	public PagesBean getPurmdList(String mcaa, String mcab, int offset,int pageSize) throws SysException {
		return purmdDao.getPurmdList(mcaa, mcab, offset, pageSize);
	}

	@Override
	public int savePurmd(Purmd purmd) throws SysException {
		return purmdDao.savePurmd(purmd);
	}

	@Override
	public int getMaxMdac() throws SysException {
		return purmdDao.getMaxMdac();
	}

	@Override
	public int delPurmd(String mdaa, String mdab, String mdacs)	throws SysException {
		return purmdDao.delPurmd(mdaa, mdab, mdacs);
	}

	@Override
	public int updatePurmd(Purmd purmd) throws SysException {
		return purmdDao.updatePurmd(purmd);
	}

	@Override
	public int changeStatus(String mdaa, String mdab, String status)throws SysException {
		return purmdDao.changeStatus(mdaa, mdab, status);
	}

	@Override
	public void delPurmcmd(String mcaa, String mcab) throws SysException {
		purmcDao.delPurmcByAaAb(mcaa, mcab);
		purmdDao.delPurmdByAaAb(mcaa, mcab);
	}

	@Override
	public void delPurmdAll(String mcaa, String mcab) throws SysException {
		purmdDao.delPurmdByAaAb(mcaa, mcab);
	}
}
